<template>
	<view class="content">
		<view class="top">
			<view class="top_bg">
				<image src="https://img.jinghushi.com/images/9/2025/10/ch716H337w1k17wh35M1DD6S7KqMmz.png" mode="widthFix"></image>
			</view>
			<view class="tit" :class="{'isScroll':isScroll}">
				<view class="t_image">
					<image class="group_tit" src="https://img.jinghushi.com/images/9/2025/10/A7B33uaFUFIxiCefvF1EcRf3B71bFI.png" mode="heightFix"></image>
				</view>
			</view>
		</view>
		<view class="list_box">
			<image class="goRule" @click="goRule" src="https://img.jinghushi.com/images/9/2025/10/nMQK4iqlLQliKbLFcqblzsF35FvkzC.png" mode="widthFix"></image>
			<!-- 预约拼团 -->
			<!-- @click="$navTo('/pages/groupbuy/yuyueList')" -->
			<view class="yu-y"  @click="yuYueTap()">预约拼团</view>
			<!-- 预约拼团列表 -->
			<view class="y-y-box">
				<!-- <view class="y-list">
					<view class="y-l-item2"  v-for="item in 1" :key="item.id"  @click="yuYueTap(item)">
						<image src="https://img.jinghushi.com/images/9/2025/10/tP4BllLP1B7ZhP5A4PRAAb1PpIHI74.png"></image>
						<view class="flex1 y-l-info">
							<text class="name">199元中秋促销米分</text>
							<view class="flex_between top">
								<view class="price"><text>￥</text>199.00</view>
								<view class="status">立即预约</view>
							</view>
						</view>
					</view>
				</view> -->
			</view>
			<!-- 预约列表 -->
			<yuLogo />
		</view>
		
		<!-- 视频按钮 -->
		<!-- <groupVideo /> -->
		<!-- <groupBar ref="bar" /> -->
	</view>

</template>

<script>
	import {
		throttle
	} from 'lodash';
	// import groupVideo from './components/video.vue';
	import yuLogo from './components/yuyue-logo.vue'
	export default {
		components: {
			// groupVideo,
			yuLogo
		},
		data() {
			return {
				isScroll: false,
			}
		},
		onPageScroll(e) {
			this.isScroll = e.scrollTop > 0
		},
		methods: {
			// 查看规则
			goRule(){
				this.$navTo('/pages/groupbuy/rule')
			},
			// 预约参团
			async yuYueTap(item) {
				const m =await uni.showModal({
					title:'温馨提示',
					content:'确定预约拼团'
				})
				if(m.cancel){
					return
				}
				uni.removeStorageSync('mid')
				uni.hideLoading()
				uni.showLoading({
					title:'请稍后'
				})
				const res= await this.$axios('DateGroup/dateInfo','POST','pintuan',{},1)
				uni.hideLoading()
				if(res.data.code==200){
					const value=res.data.data
					this.$navTo(`/pages/groupbuy/createOrder?type=2&id=${value.goodsid}&pintuan_card_id=${value.pintuan_card_id}&yuyue=1`)
				}else{
					uni.showModal({
						title:'温馨提示',
						content:res.data.data
					})
				}
			},
		}
	}
</script>

<style lang="scss">
	page {
		background-color: #fdf8ff;
	}
	.list_box{
		margin-top: -30rpx;
	}
.goRule{
	width: 100%;
}
	.nobind {
		position: relative;

		.e_close {
			width: 30rpx;
			height: 30rpx;
			position: absolute;
			right: 20rpx;
			top: 20rpx;
		}
	}

	.flex {
		display: flex;
		justify-content: space-between;
	}

	.top {
		.top_bg {
			height: 450rpx;
			width: 100%;

			image {
				height: 450rpx;
				width: 100%;
			}
		}

		.tit {
			position: absolute;
			// height: 90px;
			top: 0;
			left: 0;
			width: 100%;
			display: flex;
			flex-direction: column;
			justify-content: flex-end;
			padding: 0 30rpx;
			padding-top: calc(var(--status-bar-height) + 50rpx);
			padding-bottom: 0;

			.t_image {
				display: flex;
				align-items: center;

			}

			.group_tit {
				height: 60rpx;
			}

			.arror_box {
				width: 40rpx;
				height: 34rpx;

				.arror {
					width: 18rpx;
					height: 34rpx;
				}
			}
		}
	}

	.tit.isScroll {
		position: fixed;
		bottom: 0;
		left: 0;
		width: 100%;
		/* 确保宽度满屏 */
		height: 90px;
		background-color: yellow;
		z-index: 9999;
		/* 提高层级，避免被遮挡 */
		// padding: 0 30rpx;
		padding-bottom: 10px;
		/* 调整内边距 */
		box-sizing: border-box;
		/* 确保宽度包含内边距 */
		background: linear-gradient(180deg, #9A1FE8 0%, #FFFFFF 100%);
		border-bottom: 2px solid #CCCACD;
	}
	.yu-y{
		height: 75rpx;
		line-height: 75rpx;
		text-align: center;
		border-radius: 16rpx;
		background: #9A1FE8;
		font-size: 28rpx;
		font-weight: bold;
		color: #FFFFFF;
		letter-spacing: 2rpx;
		margin: 0 20rpx 40rpx;
	}
	.y-y-box {
		padding: 0 20rpx;
	
		.y-list {
			padding: 0 0 20rpx;
	
			.y-l-item2 {
				background-color: #fff;
				border-radius: 10rpx;
				padding: 20rpx;
				margin-top: 20rpx;
				display: flex;
				align-items: center;
				image{
					width: 108rpx;
					height: 108rpx;
					flex-shrink: 0;
					border-radius: 8rpx;
				}
				.y-l-info{
					padding-left: 20rpx;
				}
				.name {
					font-size: 28rpx;
					// font-weight: bold;
				}
				.top {
					padding: 10rpx 0;
					display: flex;
					.price{
						font-size: 36rpx;
						color: #9A1FE8;
						font-weight: bold;
						text{
							font-size: 24rpx;
							font-weight: normal;
						}
					}
					.status {
						font-size: 24rpx;
						background: #9A1FE8;
						color: #fff;
						font-weight: bold;
						width: 160rpx;
						height: 54rpx;
						line-height: 54rpx;
						border-radius: 16rpx;
						text-align: center;
						background: linear-gradient(259deg, #B62BF0 2%, #8813E2 53%);
						border-image: radial-gradient(229% 229% at 7% -121%, #FFFFFF 0%, rgba(255, 255, 255, 0) 100%) 3;
						box-shadow: inset -6px -8px 10px 0px rgba(83, 28, 118, 0.5),inset 6px 8px 4px 0px rgba(255, 255, 255, 0.2);
					}
				}
	
				.time {
					padding: 10rpx 0;
					font-size: 24rpx;
					color: rgba(#9A1FE8, 1);
				}
			}
		}
	}
</style>